#ifndef DYN_FUNCTOR_MAPS1D_LOGISTICMAP_H
#define DYN_FUNCTOR_MAPS1D_LOGISTICMAP_H

#include <armadillo>

#include "dyn_functor_maps1d.h"

/*! \brief Logistic Map class.
 *
 * This class defines the logistic map.
 * We define the iteration procedure
 * and the jacobian. We can compute the
 * pth iterate and its jacobian.
 */

class LogisticMap : public Maps1D
{
public:
    /*! The constructor sets the parameter
     * r and the pth iterate.
     */
    LogisticMap(const double parameter, const int p);

    /*! @name Logistic Map Operations
     * We declare the fondamental map
     * operations of the logistic map.
     */
    //@{
    double iterate(const double x, const int p);
    double jacobian(const double x, const int p);
    double operator()(double x) {return iterate(x,getPeriod());}
    //@}

    /*! @name Acessor functions.
     * We have a single parameter,
     * therefore we have only a single accessor
     * function pair.
     */
    //@{
    double getParameter(){return r;}
    void setParameter(const double par){r = par;}
    //@}

protected:
    /*! @name Parameters
     * The logistic map has a single parameter.
     * We declare it here.
     */
    double r;
};

#endif // DYN_FUNCTOR_MAPS1D_LOGISTICMAP_H
